package com.gx.callback;

/**
 * Created by gx on 2017/3/3.
 */
public class A implements CallBack {
    B b = new B();

    public void askQuestion(){
        System.out.println("ask b solve the problem!");
        /*
         * 自己去做其他事
         */
        new Thread(new Runnable() {

            @Override
            public void run() {
                System.out.println("A want to do another thing!");
            }
        }).start();
        /*
         * ask b to solve this problem
         */
        this.b.call(this);
    }
    @Override
    public void slove() {
        System.out.println("the problem is solve!");

    }

    /*
     * test
     */
    public static void main(String[] args)  {
        A a = new A();
        a.askQuestion();
        for (;;){

        }
    }


}
